diff options
Diffstat (limited to 'app/[lng]/evcp/(evcp)/docu-list-rule/[projectId]/code-groups/page.tsx')
| -rw-r--r-- | app/[lng]/evcp/(evcp)/docu-list-rule/[projectId]/code-groups/page.tsx | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/app/[lng]/evcp/(evcp)/docu-list-rule/[projectId]/code-groups/page.tsx b/app/[lng]/evcp/(evcp)/docu-list-rule/[projectId]/code-groups/page.tsx new file mode 100644 index 00000000..c75bf6b9 --- /dev/null +++ b/app/[lng]/evcp/(evcp)/docu-list-rule/[projectId]/code-groups/page.tsx @@ -0,0 +1,51 @@ +import * as React from "react"; +import { type SearchParams } from "@/types/table"; +import { DataTableSkeleton } from "@/components/data-table/data-table-skeleton"; +import { getCodeGroups } from "@/lib/docu-list-rule/code-groups/service"; +import { CodeGroupsTable } from "@/lib/docu-list-rule/code-groups/table/code-groups-table"; +import { searchParamsCodeGroupsCache } from "@/lib/docu-list-rule/code-groups/validation"; + + +interface IndexPageProps { + searchParams: Promise<SearchParams>; + params: Promise<{ lng: string; projectId: string }>; +} + +export default async function IndexPage(props: IndexPageProps) { + const searchParams = await props.searchParams; + const { projectId } = await props.params; + + // 프로젝트 ID를 필터에 추가 + const searchParamsWithProject = { + ...searchParams, + projectId: projectId + }; + + const search = searchParamsCodeGroupsCache.parse(searchParamsWithProject); + + const promises = Promise.all([ + getCodeGroups({ + ...search, + }), + ]); + + return ( + <> + + + <React.Suspense + fallback={ + <DataTableSkeleton + columnCount={7} + searchableColumnCount={1} + filterableColumnCount={2} + cellWidths={["8rem", "12rem", "10rem", "10rem", "12rem", "8rem", "12rem"]} + shrinkZero + /> + } + > + <CodeGroupsTable promises={promises} /> + </React.Suspense> + </> + ); +}
\ No newline at end of file |
